//
//  InitOperation.m
//  LiveDailyNews
//
//  Created by smu on 11-7-25.
//  Copyright 2011年 duk. All rights reserved.
//

#import "InitOperation.h"


@implementation InitOperation

- (void)main
{
    //创建本地文件夹 favorite
    defaultManager = [NSFileManager defaultManager];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory
                                                         , NSUserDomainMask, YES);
    NSString *favoriteDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"favorite"];
    //判断文件是否存在
    if (![defaultManager fileExistsAtPath:favoriteDirectory]) {
        [defaultManager createDirectoryAtPath:favoriteDirectory withIntermediateDirectories:YES attributes:NO error:nil];
    }
    //爆料图片文件夹
    NSString *brokeDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"broke"];
    if (![defaultManager fileExistsAtPath:brokeDirectory]) {
        [defaultManager createDirectoryAtPath:brokeDirectory withIntermediateDirectories:YES attributes:NO error:nil];
    }
}

@end
